#include "sym4sqrmainwindow.h"
#include "ui_sym4sqrmainwindow.h"

Sym4sqrMainWindow::Sym4sqrMainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Sym4sqrMainWindow)
{
    ui->setupUi(this);
}

Sym4sqrMainWindow::~Sym4sqrMainWindow()
{
    delete ui;
}

void Sym4sqrMainWindow::changeEvent(QEvent *e)
{
    QMainWindow::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void Sym4sqrMainWindow::on_loginButton_clicked()
{
    connect(&networkConn, SIGNAL(loginStatusChanged(bool)), this, SLOT(switchToMainUI()));
    networkConn.login(ui->userName->text(), ui->password->text());
}

void Sym4sqrMainWindow::switchToMainUI()
{
    qDebug() << "Switched UI";
}
